home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Audio / Patchmix / XWindowsSource / xpanel.c < prev    next >
C/C++ Source or Header  |  1992-03-28  |  3KB  |  136 lines

  1. static char rcsid[] = "$Header: xpanel.c,v 1.5 91/02/13 09:47:05 mara Exp $";
  2.  
  3. /*  x.c
  4.  *
  5.  *  Written by Mara Helmuth
  6.  *
  7.  *  Description: X graphics functions in C
  8.  *     called by graphics class
  9.  *    for Cmix X graphical interface
  10.  * 
  11.  *  $Log:    xpanel.c,v $
  12.  * Revision 1.5  91/02/13  09:47:05  mara
  13.  * panel fixes (main)
  14.  * 
  15.  * Revision 1.4  90/10/11  10:32:26  mara
  16.  * *** empty log message ***
  17.  * 
  18.  * Revision 1.3  90/09/05  22:12:10  mara
  19.  * reset and +,-,*,/ added, many fixes
  20.  * 
  21.  * Revision 1.2  90/09/02  18:19:49  mara
  22.  * NeXT fixes
  23.  * 
  24.  * Revision 1.1  90/08/27  17:10:20  mara
  25.  * Initial revision
  26.  * 
  27.  */
  28.  
  29. #include "plus.h"
  30.  
  31. /************* Panel Processes *******************************************/
  32.  
  33. void reset_choice(Panel *p, Panel_item *pi)
  34. {
  35.     Menu_item *menuitem_find();
  36.     int i;
  37.     int val;
  38.             
  39.     (void) panelitem_set(panel, pi_name, LXPTEXT_VALUE, "inst1", LXPI_NULL);
  40.     (void) panelitem_set(panel, pi_srate, LXPTEXT_VALUE, "22050", LXPI_NULL);
  41.     (void) panelitem_set(panel, pi_inchans, LXPENUM_VALUE, "1", LXPI_NULL);
  42.     (void) panelitem_set(panel, pi_outchans, LXPENUM_VALUE, "1", LXPI_NULL);
  43.     canvas_clear(canvas);
  44.  
  45.     XPutImage(dpy, canvas_pm, canvas_gc, add_im, 0, 0, 0, 10, 50, 50);
  46.     XPutImage(dpy, canvas_pm, canvas_gc, subtract_im, 0, 0, 0, 70, 50, 50);
  47.     XPutImage(dpy, canvas_pm, canvas_gc, multiply_im, 0, 0, 0, 130, 50, 50);
  48.     XPutImage(dpy, canvas_pm, canvas_gc, divide_im, 0, 0, 0, 190, 50, 50);
  49.     XPutImage(dpy, canvas_pm, canvas_gc, out_im, 0, 0, 0, 250, 50, 50);
  50.     canvas_flush(canvas);
  51.  
  52.         ugen_no = 1;
  53.         n_ugens = 0;
  54.         first_ugen = 0;
  55.         first_conn = 1;
  56.         first_out = 1;
  57.         first_add = 1;
  58.         first_sub = 1;
  59.         first_mult = 1;
  60.         first_div = 1;
  61.  
  62.     linker(RESET,ugen); // ugen is unnecessary
  63. }
  64.  
  65. int 
  66. pi_name_proc(Panel *p, Panel_item *pi, char *s)
  67. {
  68.     return 1;
  69. }
  70.  
  71. int 
  72. pi_srate_proc(Panel *p, Panel_item *pi, char *s)
  73. {
  74.     return 1;
  75. }
  76.  
  77. void 
  78. compile(Panel *p, Panel_item *pi)
  79. {
  80.     int i;
  81.     linker(COMPILE, ugen);
  82. }
  83.  
  84. void 
  85. set_data(Panel *p, Panel_item *pi)
  86. {
  87.     int i;
  88.     linker(DATA,ugen); // ugen is unnecessary
  89. }
  90.  
  91. void 
  92. run(Panel *p, Panel_item *pi)
  93. {
  94.     linker(RUN,ugen); // ugen is unnecessary
  95. }
  96.  
  97. void 
  98. rescale(Panel *p, Panel_item *pi)
  99. {
  100.     int i;
  101.     linker(RESCALE,ugen); // ugen is unnecessary
  102. }
  103.  
  104. void 
  105. play(Panel *p, Panel_item *pi)
  106. {
  107.     linker(PLAY,ugen); // ugen is unnecessary
  108. }
  109.  
  110. void 
  111. quit(Panel *p, Panel_item *pi)
  112. {
  113.     int val;
  114.  
  115.     (void) panel_block(qpanel, &val);
  116.     switch (val) {
  117.     case OK:
  118.         exit(0);
  119.         break;
  120.     case NO:
  121.         break;
  122.     default:
  123.         break;
  124.     }
  125. }
  126.  
  127. void ok(Panel *p, Panel_item *pi)
  128. {
  129.     (void) panel_unblock(qpanel, OK);
  130. }
  131.  
  132. void no(Panel *p, Panel_item *pi)
  133. {
  134.     (void) panel_unblock(qpanel, NO);
  135. }
  136.